Automatic control of inspired oxygen